<!DOCTYPE html>
<html>
{include file="public/head"}

<body>
<script>
    localStorage.setItem("{$login_userid}-konw-contest", "true");
    console.log("已经知道了，有这些比赛");
</script>
    {include file="public/nav"} {include file="public/nav-2"}
    <!-- 分割 -->
    <div class="layui-container">
        <div class="fly-panel" pad20="">
            <table class="layui-table " lay-even lay-skin="nob">
                <colgroup>
                    <col width="100">
                    <col width="300">
                    <col width="200">
                    <col width="200">
                    <col width="100">
                    <col width="100">
                </colgroup>
                <thead>
                    <tr class="layui-bg-black">
                        <th>比赛ID</th>
                        <th>比赛标题</th>
                        <th>开始时间</th>
                        <th>结束时间</th>
                        <th>类型</th>
                        <th>状态</th>
                    </tr>
                </thead>
                <tbody>
                    {foreach name="list" item="v"}
                    <tr>
                        <td>{$v.contest_id}</td>
                        <td><a href="{:url('web/contest/show?cid='.$v['contest_id'])}" class="fly-link fly-joinad">{$v.title}</a></td>
                        <td>{$v.start_time}</td>
                        <td>{$v.end_time}</td>
                        <td>
                            {if condition="($v.private==0)"}
                            <p style="color:blue">public</p>
                            {else /}
                            <p style="color:red">private</p>
                            {/if}
                        </td>
                        <td>
                            {if condition="(:strtotime($v.end_time)
                            <=time() "} <p style="color:green ">已结束</p>
        {elseif condition="(:strtotime($v.start_time)<=time() "}<p style="color:red ">进行中</p>
        {else /}<p style="color:grey ">未开始</p>
        {/if}
      </td>
      </tr>
        {/foreach}
    </tbody>
    </table>
            <div style="text-align: center; ">{$page}</div>
        </div>
      </div>
  {include file="public/foot"}
  </body>
  </html>